package com.diaohw.platform.utility.uml.core.obj;

import com.diaohw.platform.utility.uml.core.enums.RelationshipEnum;
import lombok.Data;

@Data
public class RelationshipBo {

    private String source;

    private String target;

    private RelationshipEnum type;

    private String prefix;

    public static RelationshipBo of(String source, String target, RelationshipEnum type) {
        if (source.equals(target)) {
            return null;
        }

        RelationshipBo bo = new RelationshipBo();
        bo.source = source;
        bo.target = target;
        bo.type = type;
        return bo;
    }
}
